package com.teira.rhrrealstate.session;

import java.util.Arrays;

import org.jboss.seam.annotations.Name;

import com.teira.rhrrealstate.entity.Cliente;

@Name("clienteList")
public class ClienteList extends BaseQuery<Cliente, Long> {
	private static final String EJBQL = "select cliente from Cliente cliente";

	private static final String[] RESTRICTIONS = {
			"lower(cliente.nombre) like lower(concat(#{clienteList.cliente.nombre},'%'))",
			"lower(cliente.apellido) like lower(concat(#{clienteList.cliente.apellido},'%'))", };

	private Cliente cliente = new Cliente();

	public ClienteList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public Cliente getCliente() {
		return cliente;
	}

}
